<?
/**
* Variables : $titles -> Titulos , $edit & $read & $delete permisions basics goto edit and delete
* $data -> array of row in database , unique URL BASE
*/
?>
<table width="100%" border="1" cellspacing="0">
  <tr>  
      <th>[x]</th>
    <?php 
    foreach($titles as $value){?>
      <th><?php echo $value ?></th>
    <?php } ?>
    <?php 
      echo ($edit == true)    ? "<th>&nbsp;</th>" : "";
      echo ($delete == true)  ? "<th>&nbsp;</th>" : "";
      echo ($read == true)    ? "<th>&nbsp;</th>" : "";
    ?>
  </tr>
<?php if ($data <> null){
  foreach($data as $row){?>
    <tr>
      <td><?php echo form::checkbox('check_delete['.$row->$first_field.']', TRUE); ?></td>
      <?php foreach($row as $value ){ ?>
        <td><?php echo $value?> &nbsp;</td>        
      <?php } 
        //Edit
         echo ($edit == true) ? "<td width='35' align='center'>".
          html::anchor($base.'edit/'.$row->$first_field,fpp::iconify('Editar','pencil'))."</td>" : "";
        //Delete
         echo ($delete == true) ? "<td width='35' align='center'>".
         html::anchor($base.'delete/'.$row->$first_field,fpp::iconify('Eliminar','trash'))."</td>" : "";
        //Read
         echo ($read == true) ? "<td width='35' align='center'>".
          html::anchor($base.'read/'.$row->$first_field,fpp::iconify('Ver','search'))."</td>" : "";
      ?>
    </tr>
  <?php }
}?>
</table>